""""
while 条件:
 条件满足时，做的事情1
 条件满足时，做的事情2

"""

import random
num = random.randint(1,100)

i = 1
sum = 0
while i <= 100:
    sum += i
    i += 1
print(f"1-100的和为\n{sum}")
print(f"你要猜的数字为{num}")
a_bool = True
while a_bool:
    key = int(input("请输入你要猜的数字"))
    if key == num:
        a_bool = False
    elif key < num:
        print("猜小了")
    else:
        print("猜大了")

print("恭喜你猜对了,你真是太棒了")